|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectj3deditor.bin.hierarchy.util.J3DePoint2D
public class J3DePoint2D
A point representing a location in (x, y) coordinate space, specified in integer precision.
| Constructor Summary | |
|---|---|
J3DePoint2D()
Creates an instance of J3DePoint2D at (0, 0). |
|
J3DePoint2D(int x,
int y)
Creates an instance of J3DePoint2D at (x, y). |
|
J3DePoint2D(J3DePoint2D p)
Creates an instance of J3DePoint2D with the same location
as the specified J3DePoint2D. |
|
| Method Summary | |
|---|---|
void |
absolute()
Sets each component of this point to its absolute value. |
static J3DePoint2D |
add(J3DePoint2D p1,
J3DePoint2D p2)
Returns new J3DePoint2D which value is
the vector sum of points p1 and p2. |
boolean |
equals(java.lang.Object object)
Returns true if the Object object is of type J3DePoint2D and both coordinates in it are equal to the corresponding coordinates in this J3DePoint2D. |
double |
getVectorAngle()
Returns the angle of the vector represented by this J3DePoint2D. |
double |
getVectorLength()
Returns the length of the vector represented by this J3DePoint2D. |
int |
getX()
Returns the x coordiante of this point. |
int |
getY()
Returns the x coordiante of this point. |
void |
negate()
Negates the value of this point. |
void |
setCoordinates(int x,
int y)
Sets the location of this point. |
void |
setCoordinates(J3DePoint2D p)
Sets the location of this point. |
void |
setX(int x)
Sets the x coordinate of this point. |
void |
setY(int y)
Sets the y coordinate of this point. |
static J3DePoint2D |
sub(J3DePoint2D p1,
J3DePoint2D p2)
Returns new J3DePoint2D which value is
the vector difference of points p1 and p2. |
java.lang.String |
toString()
Returns the String representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public J3DePoint2D()
J3DePoint2D at (0, 0).
public J3DePoint2D(int x,
int y)
J3DePoint2D at (x, y).
x - x coordinatey - y coordinatepublic J3DePoint2D(J3DePoint2D p)
J3DePoint2D with the same location
as the specified J3DePoint2D.
p - a point| Method Detail |
|---|
public void setX(int x)
x - new x coordinate valuepublic void setY(int y)
y - new y coordinate value
public void setCoordinates(int x,
int y)
x - new x coordinate valuey - new y coordinate valuepublic void setCoordinates(J3DePoint2D p)
p - the specified locationpublic int getX()
public int getY()
public void absolute()
public void negate()
public static J3DePoint2D add(J3DePoint2D p1,
J3DePoint2D p2)
J3DePoint2D which value is
the vector sum of points p1 and p2.
p1 - the first pointp2 - the second point
J3DePoint2D which value is
the vector sum of points p1 and p2
public static J3DePoint2D sub(J3DePoint2D p1,
J3DePoint2D p2)
J3DePoint2D which value is
the vector difference of points p1 and p2.
p1 - the first pointp2 - the second point
J3DePoint2D which value is
the vector difference of points p1 and p2public double getVectorLength()
public double getVectorAngle()
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - the Object with which the comparison is made
public java.lang.String toString()
String representation of this object.
toString in class java.lang.ObjectString representation of this object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||